﻿@model iDMS.Models.Department
@using MvcHtmlHelpers
@{
    ViewBag.Title = "Department - " + Model.FullName2;
}
<script type="text/javascript">
    $(function () {
        $("a.action").button();
    });

    
</script>
<h3>
    Department - <span class="accent">@Model.FullName2</span>
</h3>
<fieldset>
    <legend>Details</legend>
    <div class="display-label">
        Full Name</div>
    <div class="display-field">
        @Html.DisplayFor(model => model.FullName2)
    </div>
    <div class="display-label">
        Supervisor</div>
    <div class="display-field">
        @Html.DisplayFor(modelItem => Model.Employee.FullName)
        @Html.EmployeeDetailsActionLink(Model.Employee)
    </div>
</fieldset>
<h4>
    Child Departments:</h4>
<ul class="metro-list">
    @foreach (var item in (List<iDMS.Models.Department>)ViewBag.ChildDepartments)
    {
        <li>
            @item.FullName2
            @Html.IconActionLink("Department", "Employee", new { id = item.DepartmentID }, "", "ui-icon-search")
        </li>
    }
</ul>
<h4>
    Employees:</h4>
@Html.Partial("_EmployeeList", (List<iDMS.Models.Employee>)ViewBag.Employees)
<p>
    @Html.ActionLink("Edit", "DepartmentEdit", new { id = Model.DepartmentID }, new { @class = "editLink" })
    @if (ViewBag.isTopLevel)
    {
        @Html.ActionLink("Back", "Departments", null, new { @class = "btl" })
    }
    else
    {
        @Html.ActionLink("Back", "Department", new { id = Model.DepartmentParentID }, new { @class = "btl" })
    }
</p>
@Html.Partial("_AjaxDialog")
